<?php

require_once(SITE_MODULES_DIR . '/calendarhub/CalendarhubWebModule.php');

class IlccalendarhubWebModule extends CalendarhubWebModule {

    protected function initializeForPage() {
        if (!$this->isLoggedIn('eip')) {
            $this->redirectToModule('login', 'login', array('authority' => 'eip'));
        }
        $user = $this->getUser();
        $unit = $user->getAttribute('unit');
        if ($unit <> '教育處') {
            $this->unauthorizedAccess();
        }
        parent::initializeForPage();
    }
}
